﻿using FS.Common.DotNetBean;
using FS.Common.DotNetCode;
using FS.Common.DotNetJson;
using FS.Common.DotNetUI;
using FS.Business;
using System;
using System.Data;
using System.Web;
using System.Web.SessionState;
using System.Text;

namespace FS.Web.BLL.Visa
{
    /// <summary>
    /// Summary description for visa
    /// </summary>
    public class visa : IHttpHandler, IRequiresSessionState
    {

        private visa_dao _visa = new visa_dao();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Buffer = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1.0);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            string Action = context.Request["action"];
            string detailid = context.Request["detailid"];
            string cancelflag = context.Request["cancelflag"]; 
            string ls_createuserid=RequestSession.GetSessionUser().UserId.ToString();                
            string ls_createusername=RequestSession.GetSessionUser().UserName.ToString();

            string text = Action;
            if (text != null)
            {
                if (text == "CancelVisa") //消签管理
                {
                    int rtn = _visa.Ajax_ChangeVisa(detailid, cancelflag, ls_createuserid, ls_createusername);
                    context.Response.Write(rtn.ToString());
                }              
            }
            
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}